<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分类：</label>
                            <div class="col-sm-8">
                                <select data-placeholder="--选择类别--" name="catid" id="catid"
                                        class="form-control chosen-select" tabindex="2" dict-type="novel_category">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">封面：</label>
                            <div class="col-sm-8">
                                <img title="点击选择图片" id="picImage" style="cursor:pointer;width: 100px;height: 100px"
                                     src="/img/webuploader.png"/>
                                <input id="picUrl" name="picUrl" class="form-control"
                                       type="hidden">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">书名：</label>
                            <div class="col-sm-8">
                                <input id="bookName" name="bookName" class="form-control"
                                       type="text">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">作者：</label>
                            <div class="col-sm-8">
                                <input id="author" name="author" class="form-control"
                                       type="text">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">简介：</label>
                            <div class="col-sm-8">
                                <textarea id="bookDesc" name="bookDesc" class="form-control">

                                </textarea>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">评分：</label>
                            <div class="col-sm-8">
                                <input id="score" name="score" class="form-control"
                                       type="number" min="0" max="10" value="6.0">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">更新状态：</label>
                            <div class="col-sm-8">
                                <input id="bookStatus" name="bookStatus" class="form-control"
                                       type="text" value="连载">

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">更新时间：</label>
                            <div class="col-sm-8">
                                <input type="text" class="laydate-icon layer-date form-control"
                                       id="updateTime"
                                       name="updateTime"
                                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                                       style="background-color: #fff;" readonly="readonly"/>

                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/books/book/add.js">
</script>
<script type="text/javascript" src="/js/dict-util.js"></script>

<script>
    layui.use('upload', function () {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#picImage', //绑定元素
            url: '/common/sysFile/upload', //上传接口
            size: 1000,
            accept: 'file',
            done: function (r) {
                $("#picImage").attr("src", r.fileName);
                $("#picUrl").val(r.fileName);
            },
            error: function (r) {
                layer.msg(r.msg);
            }
        });
    });
</script>
</body>
</html>
